/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-06
 * Time: 12:58
 */

/**
 * 实例化内部类（非静态内部类）
 */
class OutClass {
    int data1 = 1;
    int data2 = 2;
    int data3 = 3;
    public void func1() {
        System.out.println("OutClass::func1");
    }
    class InnerClass {
        int data1 = 100;
        public int data4 = 4;
        int data5 = 5;
        public void func2() {
            System.out.println(OutClass.this.data1);
            System.out.println(data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
        }
    }
}
public class Test {
    public static void main(String[] args) {
        OutClass.InnerClass innerClass = new OutClass().new InnerClass();
        innerClass.func2();
    }
}
